package cn.likole.oj.bean;


import org.nutz.dao.entity.annotation.*;

import java.util.Date;

/**
 * 站内信
 */
@Table("mail")
@TableIndexes(@Index(fields = "toUser", unique = false))
public class Mail {

    /**
     * 站内信编号
     */
    @Id
    @Column
    private int mailId;

    /**
     * 收件人
     */
    @Column
    private int toUser;

    /**
     * 发信人,-1为系统邮件
     */
    @Column
    private int fromUser;

    /**
     * 标题
     */
    @Column
    @ColDefine(type = ColType.TEXT)
    private String title;

    /**
     * 内容
     */
    @Column
    @ColDefine(type = ColType.TEXT)
    private String content;

    /**
     * 是否未读
     */
    @Column
    @Default("true")
    private boolean newMail;

    /**
     * 发送日期
     */
    @Column
    private Date inDate;

    public int getMailId() {
        return mailId;
    }

    public void setMailId(int mailId) {
        this.mailId = mailId;
    }

    public Date getInDate() {
        return inDate;
    }

    public void setInDate(Date inDate) {
        this.inDate = inDate;
    }

    public int getToUser() {
        return toUser;
    }

    public void setToUser(int toUser) {
        this.toUser = toUser;
    }

    public int getFromUser() {
        return fromUser;
    }

    public void setFromUser(int fromUser) {
        this.fromUser = fromUser;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isNewMail() {
        return newMail;
    }

    public void setNewMail(boolean newMail) {
        this.newMail = newMail;
    }
}
